import request from "@/api/request";

export default {
    // 获得所有考试班级
    getAllTrainClass: (params) => {
        return request({
            url: "train-class/all",
            method: "post",
            data: params
        })
    },
    /**
     * 获取考试人员
     */
    getExamStaff: (param) => {
        return request({
            url: "exam/get",
            method: "get",
            params: {
                id: param
            }
        })
    },
    /**
     * 创建考试
     */
    createExam: (params) => {
        return request({
            url: "/exam/create",
            method: "post",
            data: params
        })
    },
    /**
     * 获取所有考试分页接口
     */
    getExam: (params) => {
        return request({
            url: "/exam/page",
            method: "post",
            data: params
        })
    },
    /**
     * 更新考试
     */
    updateExam: (params) => {
        return request({
            url: "/exam/update",
            method: "post",
            data: params
        })
    },
    /**
     * 获得用户答题情况
     */
    getUserExamInfo: (examId,userId) => {
        return request({
            url: "/exam/situation/user/ans/get",
            method: "get",
             params:{
                 examId:examId,
                 userId:userId
             }
        })
    },
    /**
     * 下载成绩
     */
    downloadExcel: (params) => {
        return request({
            url: "/exam/situation/score/export",
            method: "post",
            responseType: 'blob',
            params: {
                examId:params
            }
        })
    },
    /**
     * 下载提交记录
     */
    exportSubmit: (params) => {
        return request({
            url: "/exam/situation/submit/export",
            method: "post",
            responseType: 'blob',
            params: {
                examId:params
            }
        })
    },

    /**
     * 获取某场考试
     */
    examSituation: (params) => {
        return request({
            url: "/exam/situation/score/page",
            method: "post",

           data:params
        })
    },
    /**
     * 延迟学生的某场考试
     */
    delayExam: (params) => {
        return request({
            url: "/exam/delay",
            method: "post",
            data:params
        })
    },
    /**
     * 重置某场考试考生ip
     */
    resetIp: (params) => {
        return request({
            url: "/exam/ip/reset",
            method: "post",
            data:params
        })
    },
    /**
     * 阅卷
     */
    reviewExam: (params) => {
        return request({
            url: "/exam/review",
            method: "post",
            data:params
        })
    },
    /**
     * 一键阅卷
     */
    oneClickReviewExam: (params) => {
        return request({
            url: "/exam/one-click/review",
            method: "post",
            data:params
        })
    },
    /**
     * 一键阅卷
     */
    resetExam: (params) => {
        return request({
            url: "/exam/reset",
            method: "post",
            data:params
        })
    },
    /**
     * 批量阅卷
     */
    batchMarking: (params) => {
        return request({
            url: "/exam/batch/one-click/review",
            method: "post",
            params: {examId:params}
        })
    },
    /**
     * 批量阅卷
     */
    examChart: (params) => {
        return request({
            url: "/exam/portrait/query",
            method: "post",
            data: params
        })
    },
}
